package com.daguchuangyi.erp_android.productlist.select;

import com.daguchuangyi.erp_android.model.product.Product;
import com.daguchuangyi.erp_android.productlist.classifiaction.ClassificationManager;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lijianjian on 2018/3/11.
 */

public class GroupProductModel {
    private String mCategoryId = null;
    private String mCategroryName = "";
    private List<Product> mSubModels;

    public GroupProductModel() {
        mSubModels = new ArrayList<>();
    }

    public String getCategroryName() {
        return mCategroryName;
    }

    public String getCategoryId() {
        return mCategoryId;
    }

    public void setCategoryId(String categoryId) {
        mCategoryId = categoryId;
        if (categoryId == null) {
            mCategroryName = "未分类";
        } else {
            mCategroryName = ClassificationManager.getInstance().getClassificationName(categoryId);
        }
    }

    public List<Product> getSubModels() {
        return mSubModels;
    }

    public void setSubModels(List<Product> subModels) {
        mSubModels = subModels;
    }

    public void addSubProduct(Product product) {
        mSubModels.add(product);
    }
}
